home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / curses / cconq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  4.9 KB  |  174 lines  |  [TEXT/R*ch]

  1. /* Definitions for the curses interface to Xconq.
  2.    Copyright (C) 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995
  3.    Stanley T. Shebs.
  4.  
  5. Xconq is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.  See the file COPYING.  */
  9.  
  10. #include <curses.h>
  11.  
  12. #include "imf.h"
  13. #include "ui.h"
  14.  
  15. /* Escape is the standard abort character. */
  16.  
  17. #define ESCAPE '\033'
  18.  
  19. /* Backspace is for fixing strings being entered. */
  20.  
  21. #define BACKSPACE '\010'
  22.  
  23. /* ^@ does a "transparent redraw" - can be done in middle of another
  24.    command for instance. */
  25.  
  26. #define REDRAW '\000'
  27.  
  28. /* A "window" is merely a non-overlapping rectangle of character
  29.    positions. */
  30.  
  31. struct ccwin {
  32.   int x, y;
  33.   int w, h;
  34. };
  35.  
  36. /* The program can be in a number of different "modes", which affect
  37.    both the appearance of the screen and the interpretation of input. */
  38.  
  39. enum mode {
  40.     SURVEY,
  41.     MOVE,
  42.     HELP,
  43.     MORE,
  44.     PROMPT,
  45.     PROMPTXY
  46.   };
  47.  
  48. enum listsides {
  49.     ourside,
  50.     ourallies,
  51.     allsides,
  52.     numlistsides
  53.   };
  54.  
  55. extern Side *dside;
  56. extern int use_both_chars;
  57. extern int follow_action;
  58. extern int curx, cury;
  59. extern int tmpcurx, tmpcury;
  60. extern Unit *curunit;
  61. extern Unit *tmpcurunit;
  62. extern enum mode mode;
  63. extern enum mode prevmode;
  64. extern int itertime;
  65. extern char inpch;
  66. extern int prefixarg;
  67. extern char *ustr;
  68. extern int *uvec;
  69. extern int *bvec;
  70. extern int nw, nh;
  71. extern int lastx, lasty;
  72. extern char *text1;
  73. extern char *text2;
  74. extern int reqstrbeg;
  75. extern int reqstrend;
  76. extern struct ccwin *helpwin;
  77. extern HelpNode *cur_help_node;
  78. extern HelpNode *help_help_node;
  79. extern HelpNode *commands_help_node;
  80. extern HelpNode *topics_help_node;
  81. extern struct ccwin *datewin;
  82. extern struct ccwin *sideswin;
  83. extern struct ccwin *toplineswin;
  84. extern struct ccwin *clockwin;
  85. extern struct ccwin *mapwin;
  86. extern struct ccwin *listwin;
  87. extern struct ccwin *closeupwin;
  88. extern struct ccwin *sidecloseupwin;
  89. extern int mw, mh;
  90. extern int infoh;
  91. extern int vx, vy;
  92. extern int vw, vh;
  93. extern int vw2, vh2;
  94. extern VP *mvp;
  95. extern int lastvcx, lastvcy;
  96. extern int lw, lh;
  97. extern int sh;
  98. extern int drawterrain;
  99. extern int drawunits;
  100. extern int drawnames;
  101. extern int drawpeople;
  102. extern enum listsides listsides;
  103. extern int test;
  104. extern int value;
  105. extern int sorton;
  106. extern int sortorder;
  107. extern int active;
  108. extern char *dashbuffer;
  109.  
  110. extern void init_display PARAMS ((void));
  111. extern void init_interaction PARAMS ((void));
  112. extern int wait_for_char PARAMS ((void));
  113. extern void maybe_handle_input PARAMS ((int));
  114. extern void interpret_input PARAMS ((void));
  115. extern void do_dir_2 PARAMS ((int dir, int n));
  116. extern void move_survey PARAMS ((int x, int y));
  117. extern void put_on_screen PARAMS ((int x, int y));
  118.  
  119. extern int ask_bool PARAMS ((char *question, int dflt));
  120. extern int ask_unit_type PARAMS ((char *question, short *possibles));
  121. extern int ask_terrain_type PARAMS ((char *question, short *possibles));
  122. extern int ask_position PARAMS ((char *prompt, int *xp, int *yp));
  123. extern void save_cur PARAMS ((void));
  124. extern void restore_cur PARAMS ((void));
  125. extern int ask_string PARAMS ((char *prompt, char *dflt, char **strp));
  126. extern Side *ask_side PARAMS ((char *prompt, Side *dflt));
  127. extern int ask_unit PARAMS ((char *prompt, Unit **unitp));
  128. extern int ask_direction PARAMS ((char *prompt, int *dirp));
  129. extern void make_current PARAMS ((Unit *unit));
  130. extern void make_current_at PARAMS ((int x, int y));
  131. extern void interpret_help PARAMS ((void));
  132.  
  133. extern void exit_cconq PARAMS ((void));
  134.  
  135. extern struct ccwin *create_window PARAMS ((int x, int y, int w, int h));
  136.  
  137. extern int in_middle PARAMS ((int x, int y));
  138. extern void set_map_viewport PARAMS ((void));
  139. extern void set_scroll PARAMS ((void));
  140.  
  141. extern void redraw PARAMS ((void));
  142. extern void show_toplines PARAMS ((void));
  143. extern void clear_toplines PARAMS ((void));
  144. extern void show_closeup PARAMS ((void));
  145. extern void show_map PARAMS ((void));
  146. extern void draw_row PARAMS ((int x, int y, int len));
  147. extern void show_game_date PARAMS ((void));
  148. extern void show_clock PARAMS ((void));
  149. extern void show_side_list PARAMS ((void));
  150. extern void show_list PARAMS ((void));
  151. extern void show_cursor PARAMS ((void));
  152. extern void show_help PARAMS ((void));
  153.  
  154. extern void clear_window PARAMS ((struct ccwin *win));
  155.  
  156. #if 0
  157. extern void draw_mushroom PARAMS ((int x, int y, int i));
  158. #endif
  159. extern int draw_text PARAMS ((struct ccwin *win, int x, int y, char *str));
  160. extern int cur_at PARAMS ((struct ccwin *win, int x, int y));
  161.  
  162. extern void cycle_list_type PARAMS ((void));
  163. extern void cycle_list_filter PARAMS ((void));
  164. extern void cycle_list_order PARAMS ((void));
  165.  
  166. extern int auto_attack_on_move PARAMS ((Unit *, Unit *));
  167.  
  168. extern Unit *find_next_and_look PARAMS ((void));
  169.  
  170. extern void execute_command PARAMS ((void));
  171. extern void describe_commands PARAMS ((int arg, char *key, char *buf));
  172.  
  173. extern void xbeep PARAMS ((void));
  174.